﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DesignMode.ProxyPattern
{
    public class Proxy : Subject
    {
        RealSubject realSubject;
        public override void Request()
        {
            if (realSubject == null)
            {
                realSubject = new RealSubject();
            }

            preRequest();
            realSubject.Request();
            postRequest();
        }

        public void preRequest()
        { Console.WriteLine("PreRequest."); }

        public void postRequest()
        { Console.WriteLine("PostRequest."); }
    }
}
